	<layout name="newlayout" />
		 <script type="text/javascript" charset="utf-8" src="__JS__ueditor.config.js"></script>
								    <script type="text/javascript" charset="utf-8" src="__JS__ueditor.all.min.js"> </script>
								    <script type="text/javascript" charset="utf-8" src="__JS__lang/zh-cn/zh-cn.js"></script>
	<STYLE>
   .clear {  clear: both;   }
	.input_class{width:15px;height:10px;}
.num{margin: 0 5px 0 0;padding: 3px 6px;color: #57a000;text-decoration: none;border: 1px solid #ddd;-webkit-border-radius: 4px;border-radius: 4px;}
.current{margin: 0 5px 0 0;padding: 3px 6px;color: #57a000;text-decoration: none;border: 1px solid #ddd;-webkit-border-radius: 4px;border-radius: 4px;background: #469400 url('{__IMG__}bg-button-green.gif') top left repeat-x !important;border-color: #459300 !important;color: #fff !important;}
.star{color:red;}
	</STYLE>
	<div id="main-content">
			<div class="content-box" style="margin:0 auto;width:1000px;">
				<div class="content-box-header">
					<h3>{$cate['name']}>
				<?php if(empty($data['title'])){echo '新增';}else{ echo $data['title'];}?>
					</h3>
					<div class="clear"></div>
				</div>
				<div class="content-box-content">
					<div>
					<div class="notification attention png_bg"  >
							<a href="#" class="close"><img src="__IMG__cross_grey_small.png" title="Close this notification" alt="close" /></a>
							<div >
								提示：<span class="star">&nbsp;&nbsp;*&nbsp;&nbsp;</span>为必填，其他选填！！
							</div>
						</div>
<!-- 						缩略图上传 -->
						<style>
	                     .upload-img-thumb{width:100%;position: relative;}
	                     .upload-img-thumb1{position: absolute;left:70%;border:1px solid #eee;border-top:2px solid #eec;-webkit-border-radius: 6px;border-radius: 6px;}
						.upload-img-thumb2{margin: 0 auto; width: 167px; margin-bottom: 20px;}
	                     #img_preview{width: 167px; height: 125px;}
	                     #file_upload{margin:0 auto;}
						</style>
							<div class="upload-img-thumb"></div>
							<div class="upload-img-thumb1">
							<div class="upload-img-thumb2">
								<img  <?php if($data['thumb']){?>src="<?=$data['thumb'] ?>" <?php }else{?> src="__IMG__images.jpg" <?php }?>  id="img_preview">
							</div>
							<div style="width: 100%;">
									<div class="col-lg-6" style="width:100%;">
										<div class="input-group" >
													<input id="file_upload" name="thumb" type="file" multiple="true">
										</div>
										<div style="width:90px;margin:0 auto;">
										<a href="javascript:$('#file_upload').uploadify('cancel')" class="button" >删除</a>
										<a href="javascript:$('#file_upload').uploadify('upload')" class="button" style="">上传</a>
										</div>
									</div>
							</div>
							</div>
							<script>
							  function uploadImgDo(data){
								  $("#thumb").val(data);
								  }
							</script>
<!-- 							end 缩略图上传 -->
						<form action="/admin/WebSet/articleSave" method="post" id="article_add" >
							<input type="hidden"  name="id" value="{$data['id']}" />
							<input type="hidden" name="thumb"  value="{$data['thumb']}"  id="thumb"/>
							<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
								<p>
										标题：<span class="star">*</span>&nbsp;<input class="text-input small-input not_null" type="text"  name="title" value="{$data['title']}" /> <span class="input-notification success png_bg">Successful message</span> <!-- Classes for input-notification: success, error, information, attention -->
								</p>
								
								<p>
									栏目：
									<select name="cate_id" >
										  <?php 
								         	 $sum=0;
								         	 $mod=$cate['model_id'];
								            function str_num(){
												 global $sum;
												$str="";
								            	for ($i=0;$i<$sum;$i++){
								            		$str=$str."&nbsp;&nbsp;&nbsp;&nbsp;";
								            	}
								            	if($sum!=0){
								            		$str=$str."|—";
								            	}
								            	return $str;
								            }
								            function cate_str($data,$cate_id,$mod){
								    			      global $sum;
								  				foreach ($data as $r){
												?>
										<option value="<?php echo $r['id']?>"  <?php if(is_array($r['son'])){echo "disabled='disabled'";}?> <?php if($cate_id==$r['id']){?>selected="selected"<?php }?> ><?php echo  str_num().$r['name']?></option>
										         <?php 
										if(is_array($r['son']))
											{
												$sum++;
												cate_str($r['son'],$cate_id,$mod);
												$sum--;
											}
						  				}
						            }
						            ?>
										 <?php 
										$cateinfo= get_cateinfo();cate_str($cateinfo,$cate['id'],$mod);?>         
									</select>
									 <span class="input-notification  png_bg"></span>
								</p>
								<p>
								<label>描述：</label>    
									<input class="text-input medium-input datepicker" type="text"  name="description"  value="{$data['description']}" /> <span class="input-notification  png_bg"></span>
								</p>
									<div>
								<label>推进位：</label>   
								<style>
								#position {overflow:hidden;}
								#position li {float:left;}
								</style> 
									<ul id="position">
								<?php
								$db=D("Position");
								$model=$db->selectPositionInfo($mod,$data['cate_id'],$data['id']);
							       foreach ($model as $r){?>
							       			<li> <input type="checkbox"  <?php if(!empty($r["flag"])){?>checked="checked"<?php }?> value="<?php echo $r['id']?>" name="p[]"/> <?php echo $r['name']?></li>
							       <?php }?>
									</ul>
								</div>
								<p>
								<label>SEO-标题（seo_title）：</label>    
									<input class="text-input medium-input datepicker" type="text"  name="seo_title"  value="{$data['seo_title']}"/> <span class="input-notification  png_bg"></span>
								</p>
								<p>
								<label>SEO-关键字（seo_key）：</label>    
									<input class="text-input medium-input datepicker" type="text"  name="seo_key"   value="{$data['seo_key']}"/> <span class="input-notification  png_bg"></span>
								</p>
								
								<p>
							<label>	SEO-描述（seo_decription）：</label>    								
								<input class="text-input large-input" type="text"  name="seo_description"  value="{$data['seo_description']}"/>
								</p>
								<p>
									单价：<input class="text-input small-input" type="text"  name="seo_description"  value="{$data['seo_description']}"/>
									数量：<input class="text-input small-input" type="text"  name="seo_description"  value="{$data['seo_description']}"/>
								</p>
								
									<label><span class="star">*</span>&nbsp;内容：</label>        
								
								<script id="container" name="content" type="text/plain">
																{$data['content']}
									</script>
									<script type="text/javascript">
									    var editor = UE.getEditor('container')
									</script>
								<p>
									<input class="button" type="button" value="保存"  id="tijiao" onclick="model_save();" />
								</p>
							</fieldset>
							<div class="clear"></div><!-- End .clear -->
						</form>
					</div> <!-- End #tab2 -->      
				</div> <!-- End .content-box-content -->
			</div> <!-- End .content-box -->
			
			<div id="footer">
				<small> <!-- Remove this notice or replace it with whatever you want -->
						&#169; Copyright 2009 Your Company | Powered by <a href="javascript:">Simpla Admin</a> | <a href="#">Top</a>
				</small>
			</div><!-- End #footer -->
			
		</div> <!-- End #main-content -->
<script>
//提交表单
$(function(){
						//表单检查是否为空
						$(".not_null").blur(function(){
							var obj=$(this).find("+span");
								 if($(this).val()==""){
									 obj.removeClass("success");
									 obj.addClass("error");
									 obj.html("不能为空！");
									 $("#tijiao").attr("disabled","disabled"); 
								 } else{
									 obj.removeClass("error");
									 obj.addClass("success");
									 $("#tijiao").removeAttr("disabled"); 
								 }
						});
	
});
	  function model_save(){
	      $("#article_add").submit();
	    }
</script>